/**
 * Created by lixiang on 24/04/2017.
 */

$(function () {


    var saleVue = new Vue({
        el:'#divController',
        data:{
            saleInfo:{
                productSysNo : $("#sysNo").val(),
                color: "",
                size: $("#size").val(),
                salePrice:$("#price").val(),
                sex:"1",
                saleNum:"1",
                mobilePhone:""
            }

        },
        methods:{
            saveSale:function () {


                this.$http.post(webRoot+'/sale/newSaleInfo/', this.saleInfo,  {credentials: true}).then(function(response)
                    {
                        var datas = response.body;
                        if(datas['error']=='0'){
                            alert(datas['message']);

                            window.location.href="http://www.bbgkh.shop";
                        }else{
                            alert(datas['message']);
                        }

                    },
                    function(response){
                        // error callback
                    });

            }

        }

    });




});




